{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
<!--数据列表页面-->
<section class="content">

    <!--顶部搜索筛选-->
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-body">
                    <form class="form-inline searchForm" id="searchForm" action="{:url('firmindex')}" method="GET">

                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$member_id ? $member_id : '' ;}"
                                   name="member_id" id="member_id" class="form-control input-sm"
                                   placeholder="融云ID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$me_uid ? $me_uid : '' ;}"
                                   name="me_uid" id="me_uid" class="form-control input-sm"
                                   placeholder="用户UID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$me_phone ? $me_phone : '' ;}"
                                   name="me_phone" id="me_phone" class="form-control input-sm"
                                   placeholder="用户手机号/昵称搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$name ? $name : '' ;}"
                                   name="name" id="name" class="form-control input-sm"
                                   placeholder="企业名称搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$car_name ? $car_name : '' ;}"
                                   name="car_name" id="car_name" class="form-control input-sm"
                                   placeholder="车辆名称搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$car_vin ? $car_vin : '' ;}"
                                   name="car_vin" id="car_vin" class="form-control input-sm"
                                   placeholder="车辆VIN码搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$car_model ? $car_model : '' ;}"
                                   name="car_model" id="car_model" class="form-control input-sm"
                                   placeholder="品牌型号搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="add_admin_id" id="add_admin_id" class="form-control input-sm index-search">
                                <option value="">-认证途径-</option>
                                <option value="0"{if isset($add_admin_id) && $add_admin_id=='0'}selected{/if}>自行认证</option>
                                <option value="1"{if isset($add_admin_id) && $add_admin_id=='1'}selected{/if}>管理端认证</option>
                            </select>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$add_time|default=''}" readonly name="add_time" id="add_time"
                                   class="form-control input-sm indexSearchDateRange" placeholder="认证时间搜索">
                        </div>
                        <script>
                            laydate.render({
                                elem: '#add_time',
                                range: true,
                            });
                        </script>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="is_pass" id="is_pass" class="form-control input-sm index-search">
                                <option value="">-审核类型-</option>
                                <option value="1"{if isset($is_pass) && $is_pass=='1'}selected{/if}>无需审核，直接通过</option>
                                <option value="2"{if isset($is_pass) && $is_pass=='2'}selected{/if}>需要审核</option>
                            </select>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="state" id="state" class="form-control input-sm index-search">
                                <option value="">-审核状态-</option>
                                <option value="0"{if isset($state) && $state=='0'}selected{/if}>待审核</option>
                                <option value="1"{if isset($state) && $state=='1'}selected{/if}>已通过</option>
                                <option value="2"{if isset($state) && $state=='2'}selected{/if}>已拒绝</option>
                            </select>
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
                            </button>
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
                                    class="fa  fa-eraser"></i> 清空查询
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="box">

                <!--数据列表顶部-->
                <div class="box-header">
                    <div>
                        <a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
                            <i class="fa fa-refresh"></i> 刷新
                        </a>
                    </div>
                </div>

                <div class="box-body table-responsive">
                    <table class="table table-hover table-bordered datatable" width="100%">
                        <thead>
                        <tr style="white-space: nowrap">
                            <th style="text-align: center;vertical-align: middle;">融云ID</th>
                            <th style="text-align: center;vertical-align: middle;">用户UID</th>
                            <th style="text-align: center;vertical-align: middle;">昵称 / 手机号</th>
                            <th style="text-align: center;vertical-align: middle;">认证途径</th>
                            <th style="text-align: center;vertical-align: middle;">认证类型</th>
                            <th style="text-align: center;vertical-align: middle;">行驶证</th>
                            <th style="text-align: center;vertical-align: middle;">小视频</th>
                            <th style="text-align: center;vertical-align: middle;">企业名称</th>
                            <th style="text-align: center;vertical-align: middle;">车辆VIN码</th>
                            <th style="text-align: center;vertical-align: middle;">车辆名称</th>
<!--                            <th style="text-align: center;vertical-align: middle;">品牌型号</th>-->
                            <th style="text-align: center;vertical-align: middle;">车辆价格</th>
                            <th style="text-align: center;vertical-align: middle;">认证圈层</th>
                            <th style="text-align: center;vertical-align: middle;">认证时间</th>
                            <th style="text-align: center;vertical-align: middle;">审核类型</th>
                            <th style="text-align: center;vertical-align: middle;">审核状态</th>
                            <th style="text-align: center;vertical-align: middle;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name='data' id='item' key='data_key'}
                        <tr>
                            <td style="text-align: center;vertical-align: middle;">{$item.member_id}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.me_uid}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.me_nick_name} / {$item.me_phone}</td>
                            {if $item.me_carname == '买圈车主' && $item.add_admin_id == 0}
                            <td style="text-align: center;vertical-align: middle;"><span style="color: red;">{$item.add_admin_id_word}</span></td>
                            {else/}
                            {if $item.add_admin_id == 0}
                            <td style="text-align: center;vertical-align: middle;"><span style="color: green;">{$item.add_admin_id_word}</span></td>
                            {else/}
                            <td style="text-align: center;vertical-align: middle;"><span style="color: blue;">{$item.add_admin_id_word}</span></td>
                            {/if}
                            {/if}
                            <td style="text-align: center;vertical-align: middle;">{$item.type_word}</td>
                            <td style="text-align: center;vertical-align: middle;" class="photo-list"><img class="dataListImg" src="{$item.img}"></td>
                            <td style="text-align: center;vertical-align: middle;" class="">
                                <video width="130" height="70" controls>
                                    <source src="{$item.state_video}" type="video/mp4">
                                </video>
                            </td>
                            <td style="text-align: center;vertical-align: middle;">{$item.name}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.car_vin}</td>
                            <td style="text-align: center;vertical-align: middle;" title="{$item.car_pp_name}：{$item.car_all_name}">{$item.car_name}</td>
<!--                            <td style="text-align: center;vertical-align: middle;">{$item.car_model}</td>-->
                            <td style="text-align: center;vertical-align: middle;">{$item.car_money_word}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.circle_name}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.add_time}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.is_pass_word}</td>
                            <td style="text-align: center;vertical-align: middle;">
                                {if $item.state==0}
                                <span style="color: blue">{$item.state_word}</span>
                                {/if}
                                {if $item.state==1}
                                <span style="color: green">{$item.state_word}</span>
                                {/if}
                                {if $item.state==2}
                                <span style="color: red">{$item.state_word}</span>
                                {/if}
                            </td>
                            <td style="text-align: center;vertical-align: middle;">
                                {if $item.state==0}
<!--                                <a data-id="{$item.id}" data-url="passfirm" data-confirm="2" data-type="2"-->
<!--                                   class="btn btn-success btn-xs AjaxButton"  title="通过认证" data-toggle="tooltip" style="margin-top: 3px;">-->
<!--                                    通过认证-->
<!--                                </a>-->
<!--                                <a data-id="{$item.id}" data-url="refusefirm" data-confirm="2" data-type="2"-->
<!--                                   class="btn btn-danger btn-xs AjaxButton"  title="拒绝认证" data-toggle="tooltip" style="margin-top: 3px;">-->
<!--                                    拒绝认证-->
<!--                                </a>-->
                                <a class="btn btn-success btn-xs AjaxButton" data-toggle="tooltip" title="通过【企业车辆认证】认证"  data-id="{$item.id}" data-confirm-title="通过【企业车辆认证】认证" data-confirm-content='您确定要通过此用户的【企业车辆认证】信息？' data-url="{:url('passfirm')}" style="margin-top: 3px;">
                                    通过认证
                                </a>
                                <a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="拒绝【企业车辆认证】认证"  data-id="{$item.id}" data-confirm-title="拒绝【企业车辆认证】认证" data-confirm-content='您确定要拒绝此用户的【企业车辆认证】信息？' data-url="{:url('refusefirm')}" style="margin-top: 3px;">
                                    拒绝认证
                                </a>
                                {else/}
                                {if $item.state==0 || $item.state==1}
                                <a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="清除认证"  data-id="{$item.id}" data-confirm-title="清除【企业车辆认证】确认" data-confirm-content='您确定要清除此用户的【企业车辆认证】信息？清除后不可恢复！' data-url="{:url('delfirm')}">
                                    <i class="fa fa-trash"> 清除认证</i>
                                </a>
                                {/if}
                                {/if}
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>

                <!-- 数据列表底部 -->
                <div class="box-footer">
                    {$page|raw}
                    <label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
                        <small>共{$total}条记录</small>&nbsp;
                        <small>每页显示</small>
                        &nbsp;
                        <select class="input-sm" onchange="changePerPage(this)">
                            <option value="10" {if $admin.per_page==10}selected{/if}>10</option>
                            <option value="20" {if $admin.per_page==20}selected{/if}>20</option>
                            <option value="30" {if $admin.per_page==30}selected{/if}>30</option>
                            <option value="50" {if $admin.per_page==50}selected{/if}>50</option>
                            <option value="100" {if $admin.per_page==100}selected{/if}>100</option>
                        </select>
                        &nbsp;
                        <small>条记录</small>
                    </label>
                </div>

            </div>
        </div>
    </div>
</section>
<script>
    $(function () {
        $('.photo-list img').on('click', function () {
            layer.photos({
                photos: '.photo-list',
                shadeClose: false,
                closeBtn: 2,
                anim: 5
            });
        })
    });
</script>
{/block}

